<?php
class Message {

	var $text;
	var $type;

	function __construct($text, $type){
		$this->text = $text;
		$this->type = $type;
	}

	function showInfo() {
		echo "<div class='center'><table class='msg_info'><tr><th><img src='./img/icons/info.png'></th><td>$this->text</td></tr></table></div>";
	}

	function showWarning() {
		echo "<div class='center'><table class='msg_warning'><tr><th><img src='./img/icons/warning.png'></th><td>$this->text</td></tr></table></div>";
	}
	
	function show() {
		if($this->type == MSG_INFO) {
			$this->showInfo();
		} else if($this->type == MSG_WARNING) {
			$this->showWarning();
		}
	}

}
?>